<!DOCTYPE html>
<html lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>新零售微店后台首页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link th:href="@{/layui/css/layui.css}"  rel="stylesheet">
    <link th:href="@{/style/admin.css}"  rel="stylesheet">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">编号</label>
                    <div class="layui-input-block">
                        <input type="text" name="loginname" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-user-back-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">
            <div style="padding-bottom: 10px;">
                <button class="layui-btn layuiadmin-btn-admin" data-type="batchdel">删除</button>
                <!--<button class="layui-btn layuiadmin-btn-admin" data-type="add" onclick="WinOpenAdd();">添加</button>-->
            </div>

            <table class="layui-hide" id="address"></table>

            <script type="text/html" id="barDemo">
                <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail" href="/getOrderDetails?No={{d.orderNo}}">查看</a>
                <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
            </script>

        </div>
    </div>
</div>
<style>
    .layui-body{overflow-y: scroll;}
</style>
<script th:src="@{/layui/layui.js}"></script>
<!--<script th:src="@{/js/order.js}"></script>-->
<script th:inline="javascript">
    var table;
    layui.use('table', function(){
        table = layui.table
            ,form = layui.form;
        table.render({
            elem: '#address'
            ,url:'/getFreightList'
            ,cellMinWidth: 80
            ,cols: [[
                {type:'numbers'}
                ,{type: 'checkbox'}
                ,{field:'id', title:'运费ID'}
                // ,{field:'pOrderTime', title:'下单时间',templet :function (row){return createTime(row.pOrderTime);}}
                ,{field:'areanames', title:'运费区域'}
                ,{field:'areano', title: '运费大区'}
                ,{field:'notFirstWeight', title: '阶梯重量'}
                ,{field:'notFirstWeightPrice', title: '阶梯总量价格'}
                ,{field:'firstWeight', title: '首重'}
                ,{field:'increment', title: '增重'}
                ,{field:'constant', title: '常量'}
                ,{field:'id', title:'操作', minWidth:180, templet: '#barDemo', unresize: true}

            ]]
            ,page: true
        });
    });

    function createTime(v){
        return new Date(parseInt(v)).toLocaleString()
    }
    /**重写toLocaleString方法*/
    Date.prototype.toLocaleString = function() {
        var y = this.getFullYear();
        var m = this.getMonth()+1;
        m = m<10?'0'+m:m;
        var d = this.getDate();
        d = d<10?("0"+d):d;
        var h = this.getHours();
        h = h<10?("0"+h):h;
        var M = this.getMinutes();
        M = M<10?("0"+M):M;
        var S=this.getSeconds();
        S=S<10?("0"+S):S;
        return y+"-"+m+"-"+d+" "+h+":"+M+":"+S;}

    function openDetails() {
        layer.open({
            type: 2
            , title: '添加会员等级'
            , content: '/getOrderDetails'
            , area: ['420px', '420px']
            , btn: ['确定', '取消']
            , yes: function (index, layero) {
                debugger;
                var body = layer.getChildFrame('body', index); //得到iframe页的body内容
                var loginname = body.find("#loginname").val();
                alert(loginname);

                //table.reload('LAY-user-front-submit'); //数据刷新
                layer.close(index); //关闭弹层
            }
        });
    }





</script>
</body>
</html>

